﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="BI_BGM_Request.aspx.cs" Inherits="KPIS.GERP.GBMS.APP_UI.Form.BI_BGM_Request" %>

<%@ Register TagPrefix="telerik" Namespace="Telerik.Charting" Assembly="Telerik.Web.UI" %>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<html>
<head id="Head1" runat="server">
<title>ข้อมูลแผนภูมิคำของบประมาณ</title>
<script type="text/javascript" src="../../Scripts/Common.js"></script>
<link rel="Stylesheet" href="../../Styles/StyleSheet.css" type="text/css" />
<style type="text/css">
    .margintop {
        margin-top: 100px;
    }
</style>
</head>
<body>
    <form id="form1" runat="server" class="defaultFont">
        <asp:ScriptManager ID="ScriptManager" runat="server" />
        
        <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
            <AjaxSettings>
                <telerik:AjaxSetting AjaxControlID="panelSubAct">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="panelSubAct" LoadingPanelID="RadAjaxLoadingPanel1" />
                    </UpdatedControls>
                </telerik:AjaxSetting>
            </AjaxSettings>
        </telerik:RadAjaxManager>
        
        <asp:Panel ID="panelSubAct" runat="server" CssClass="padding10">
            <asp:ImageButton ID="btnFilter" runat="server" 
                ImageUrl="~/APP_UI/Image/FilterButton.png" onclick="btnFilter_Click" />
            <asp:Panel ID="panelFilter" runat="server" Height="450px" Width="900px"
                class="defaultFont" Visible="false">
                <table width="900px">
                    <tr>
                        <td width="450px" valign="top">
                            <ul class="formList">
                                <li class="lastListItem">
                                    <table class="header-grid">
                                        <tr>
                                            <td>
                                                กรองข้อมูล
                                            </td>
                                        </tr>
                                    </table>
                                </li>
                                <li>
                                    <table class="defaultFont">
                                        <tr>
                                            <td width="100px">
                                                ปี :
                                            </td>
                                            <td>
                                                <telerik:RadComboBox ID="cbBgmYear" runat="server" Width="200px" ZIndex="9000" 
                                                    AutoPostBack="True" onselectedindexchanged="cbBgmYear_SelectedIndexChanged" />
                                            </td>
                                        </tr>
                                    </table>
                                </li>
                                <li>
                                    <table class="defaultFont">
                                        <tr>
                                            <td width="100px">
                                                หน่วยงาน :
                                            </td>
                                            <td>
                                                <telerik:RadComboBox ID="cbJobsiteSeq" runat="server" Width="200px" ZIndex="9000"
                                                    DataTextField="text" DataValueField="value" AutoPostBack="True" 
                                                    onselectedindexchanged="cbJobsiteSeq_SelectedIndexChanged" />
                                            </td>
                                        </tr>
                                    </table>
                                </li>
                                <li>
                                    <table class="defaultFont">
                                        <tr>
                                            <td width="100px">
                                                กิจกรรมย่อย :
                                            </td>
                                            <td>
                                                <telerik:RadComboBox ID="cbSubActSeq" runat="server" Width="200px" ZIndex="9000"
                                                    DataTextField="text" DataValueField="value" AutoPostBack="True" 
                                                    onselectedindexchanged="cbSubActSeq_SelectedIndexChanged" />
                                            </td>
                                        </tr>
                                    </table>
                                </li>
                                <li>
                                    <table class="defaultFont">
                                        <tr>
                                            <td width="100px">
                                                โครงการ :
                                            </td>
                                            <td>
                                                <telerik:RadComboBox ID="cbProjectSeq" runat="server" Width="200px" ZIndex="9000"
                                                    DataTextField="bgm_prj_name" DataValueField="Sequence" />
                                            </td>
                                        </tr>
                                    </table>
                                </li>
                                <li>
                                    <table class="defaultFont">
                                        <tr>
                                            <td width="100px">
                                                แหล่งเงิน :
                                            </td>
                                            <td>
                                                <telerik:RadComboBox ID="cbSourceSeq" runat="server" Width="200px" ZIndex="9000"
                                                    DataTextField="text" DataValueField="value" />
                                            </td>
                                        </tr>
                                    </table>
                                </li>
                                <li>
                                    <table class="defaultFont">
                                        <tr>
                                            <td width="100px">
                                                งบรายจ่าย :
                                            </td>
                                            <td>
                                                <telerik:RadComboBox ID="cbExpenseGroup" runat="server" Width="200px" ZIndex="9000"
                                                    DataTextField="text" DataValueField="value" />
                                            </td>
                                        </tr>
                                    </table>
                                </li>
                                <%--<li>
                                    <table class="defaultFont">
                                        <tr>
                                            <td width="100px">
                                            </td>
                                            <td>
                                                <telerik:RadComboBox ID="cbSkin" runat="server" Width="200px" />
                                            </td>
                                        </tr>
                                    </table>
                                </li>--%>
                            </ul>
                        </td>
                        <td width="450px" valign="top">
                            <ul class="formList">
                                <li class="lastListItem">
                                    <table class="header-grid">
                                        <tr>
                                            <td>
                                                รูปแบบแผนภูมิ
                                            </td>
                                        </tr>
                                    </table>
                                </li>
                                <li>
                                    <table width="440px">
                                        <tr>
                                            <td align="left" style="visibility:hidden">
                                                <asp:RadioButtonList ID="rblChartName" runat="server" CssClass="defaultFont" >
                                                    <asp:ListItem Text="แสดงข้อมูลคำของบประมาณ" Value="1" Selected="True" />
                                                </asp:RadioButtonList>
                                                    <!--<asp:ListItem Text="แสดงข้อมูลเปรียบเทียบ 2 ปีย้อนหลัง" Value="2" />-->
                                            </td>
                                        </tr>
                                    </table>
                                </li>
                                <li class="lastListItem">
                                    <table width="440px">
                                        <tr>
                                            <td align="left">
                                                <asp:RadioButtonList ID="rblChartType" runat="server" CssClass="defaultFont">
                                                    <asp:ListItem Text="แผนภูมิวงกลม" Value="1" Selected="True" />
                                                    <asp:ListItem Text="แผนภูมิแท่ง" Value="2" />
                                                </asp:RadioButtonList>
                                            </td>
                                        </tr>
                                    </table>
                                </li>
                                <li class="lastListItem">
                                    <table class="header-grid">
                                        <tr>
                                            <td>
                                                ข้อมูลของแผนภูมิ
                                            </td>
                                        </tr>
                                    </table>
                                </li>
                                <li class="lastListItem">
                                    <table width="440px">
                                        <tr>
                                            <td align="left">
                                                <asp:RadioButtonList ID="rblDataType" runat="server" CssClass="defaultFont">
                                                    <asp:ListItem Text="ระดับกิจกรรมย่อย" Value="1" Selected="True" />
                                                    <asp:ListItem Text="ระดับหน่วยงาน" Value="2" />
                                                    <asp:ListItem Text="ระดับโครงการ" Value="3" />
                                                    <asp:ListItem Text="ระดับแหล่งเงิน" Value="4" />
                                                    <asp:ListItem Text="ระดับงบค่าใช้จ่าย" Value="5" />
                                                    <asp:ListItem Text="ระดับหมวดค่าใช้จ่าย" Value="6" />
                                                    <asp:ListItem Text="ระดับรายการค่าใช้จ่าย" Value="7" />
                                                    <asp:ListItem Text="ระดับสินค้าและบริการ" Value="8" />
                                                    <asp:ListItem Text="ระดับตลาด/ภูมิภาค/ประเทศ" Value="9" />
                                                    <asp:ListItem Text="ระดับโครงการบูรณาการ" Value="10" />
                                                </asp:RadioButtonList>
                                            </td>
                                        </tr>
                                    </table>
                                </li>
                            </ul>
                        </td>
                    </tr>
                    <tr height="40px">
                        <td colspan="2" align="center">
                        </td>
                    </tr>
                    <tr >
                        <td colspan="2" align="center"> 
                                <asp:Button ID="btnOK" runat="server" Text="แสดงแผนภูมิ" 
                                    onclick="btnOK_Click" Width="116px" CssClass="margintop" />
                        </td>
                    </tr>
                </table>
            </asp:Panel>
            <telerik:RadChart ID="SubActChart" runat="server" DefaultType="Pie"
                AutoTextWrap="true" OnItemDataBound="Chart_ItemDataBound" 
                Skin="Inox" AutoLayout="true" IntelligentLabelsEnabled="true" >
                <Appearance Dimensions-Height="490px" Dimensions-Width="960px" >
                    <FillStyle FillType="Image">
                        <FillSettings BackgroundImage="{chart}" ImageDrawMode="Flip">
                        </FillSettings>
                    </FillStyle>
                    <Border Color="111, 111, 111" />
                </Appearance>                
                <Series>
                    <telerik:ChartSeries Name="Series 1"  DataYColumn="total_amount"
                        DefaultLabelValue="#Y{C}" >
                        <Appearance LegendDisplayMode="ItemLabels">
                            <FillStyle FillType="ComplexGradient" MainColor="211, 185, 123">
                                <FillSettings>
                                    <ComplexGradient>
                                        <telerik:GradientElement Color="222, 202, 152" />
                                        <telerik:GradientElement Color="211, 185, 123" Position="0.5" />
                                        <telerik:GradientElement Color="183, 154, 84" Position="1" />
                                    </ComplexGradient>
                                </FillSettings>
                            </FillStyle>
                            <TextAppearance TextProperties-Color="160, 160, 160">
                            </TextAppearance>
                            <Border Color="187, 149, 58" />
                        </Appearance>
                    </telerik:ChartSeries>
                </Series>
                <Legend>
                    <Appearance Dimensions-Margins="16%, 3%, 1px, 1px" 
                        Position-AlignedPosition="Right" Overflow="Column" Figure="" >
                        <ItemTextAppearance TextProperties-Color="Black">
                        </ItemTextAppearance>
                        <FillStyle MainColor="Transparent">
                        </FillStyle>
                        <Border Width="0" />
                    </Appearance>
                </Legend>
                <PlotArea > 
                    <XAxis>
                        <Appearance Color="Transparent">
                            <MajorGridLines Color="213, 213, 213" />
                            <TextAppearance TextProperties-Color="17, 17, 17">
                            </TextAppearance>
                        </Appearance>
                        <AxisLabel>
                            <TextBlock>
                                <Appearance TextProperties-Color="17, 17, 17">
                                </Appearance>
                            </TextBlock>
                        </AxisLabel>
                    </XAxis>
                    <YAxis>
                        <Appearance Color="Transparent" MinorTick-Width="0">
                            <MajorGridLines Color="213, 213, 213" PenStyle="Dash" />
                            <MinorGridLines Color="213, 213, 213" Width="0" />
                            <TextAppearance TextProperties-Color="17, 17, 17">
                            </TextAppearance>
                        </Appearance>
                        <AxisLabel>
                            <TextBlock>
                                <Appearance TextProperties-Color="17, 17, 17">
                                </Appearance>
                            </TextBlock>
                        </AxisLabel>
                    </YAxis>
                    <Appearance>
                        <FillStyle FillType="Solid" MainColor="White">
                        </FillStyle>
                        <Border Color="142, 142, 142" />
                    </Appearance>
                </PlotArea>
                <ChartTitle>
                    <Appearance>
                        <FillStyle MainColor="Transparent">
                        </FillStyle>
                    </Appearance>
                    <TextBlock>
                        <Appearance TextProperties-Color="17, 17, 17" TextProperties-Font="Arial, 16pt">
                        </Appearance>
                    </TextBlock>
                </ChartTitle>
            </telerik:RadChart>
        </asp:Panel>
    </form>
</body>
</html>
